<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" href="../css/reset.css">
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../fonts/iconfont/iconfont.css">
    <link rel="stylesheet" href="../css/index.css" />
    <title>货栈应用
    </title>
    <script src="../js/comment.js"></script>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script type="text/javascript" src="../js/aui-toast.js"></script>
    <script type="text/javascript" src="../js/jquery.qrcode.min.js"></script>
    <script type="text/javascript">
        function setId(id) {
            window.localStorage.setItem("id", id); //保存数据
        }
        // 请求用户登录数据
        function openPickUpPage() {
            window.WebViewJavascriptBridge.callHandler(
                'openPickUpPage', {
                    'param': 'hhhhh'
                },
                function(responseData) {}
            );
        }



        var id, storeId;

        if (isIOS()) {
            getAppUserInfo(function(res) {
                var obj = {
                    token: res.token,
                    mobile: res.mobile,
                    id: res.bossId,
                    storeId: res.lastStore,
                    storeSn: res.storeSn,
                    storeFlag: res.storeFlag,

                }
                obj = JSON.stringify(obj)
                window.localStorage.setItem("obj", obj)
            });

        } else if (isAndroid()) {

            // 请求用户登录数据
            function getUserInfo() {
                window.WebViewJavascriptBridge.callHandler(
                    'getUserInfo', {
                        'param': 'getUserInfo'
                    },
                    function(responseData) {
                        console.log("responseData：" + responseData)
                        alert(responseData)
                    }
                );
            }

            function connectWebViewJavascriptBridge(callback) {

                if (window.WebViewJavascriptBridge) {
                    callback(WebViewJavascriptBridge)
                } else {
                    document.addEventListener(
                        'WebViewJavascriptBridgeReady',
                        function() {
                            callback(WebViewJavascriptBridge)
                        },
                        false
                    );
                }
            }

            connectWebViewJavascriptBridge(function(bridge) {
                bridge.init(function(message, responseCallback) {
                    console.log('JS got a message', message);

                });

                // 一打开应用模块我就把你所需要的参数发送给你， 就是data
                bridge.registerHandler("functionInJs", function(data, responseCallback) {
                    var obj = data

                    var responseData = "Javascript 收到原生的方法，现在回调给原生：" + data;
                    responseCallback(responseData);
                    window.localStorage.setItem("obj", obj)
                });
            });




        }

        function storeFlag() {
            var obj = JSON.parse(window.localStorage.getItem('obj'));
            if (obj.storeFlag == "there") {
                sign();
            } else {
                openNewPage('integral_richScan.html');
            }
        }

        function sign() {
            window.WebViewJavascriptBridge.callHandler(
                'signIn', {
                    'param': '3.0签到'
                },
                function(responseData) {}
            );
        }



        //精品验证
        function boutique() {
            var obj = JSON.parse(window.localStorage.getItem('obj'));
            if (obj.storeFlag == "there" || "two" || "one") {
                sign();
            } else if (obj.storeFlag == "no") {
                showDefaultMsg('fail');
            }
        }
        var toast = new auiToast({})
            //提示发送成功和失败
        function showDefaultMsg(type) {
            console.log(123);
            switch (type) {
                case "success":
                    toast.success({
                        title: "短信发送成功",
                        duration: 1500
                    });
                    break;
                case "fail":
                    toast.fail({
                        title: "该门店没有加盟方案",
                        duration: 1500
                    });
                    break;
            }
        }
        //跳转新页面
        function openNewPage(url) {
            if (isAndroid()) {
                window.WebViewJavascriptBridge.callHandler(
                    'openNewPage', {
                        'param': url
                    },
                    function(responseData) {}
                );
            } else if (isIOS()) {
                window.location.href = url
            }
        }
    </script>
</head>

<body >

    <header class="aui-bar aui-bar-nav aui-bar-light" style="background: #4e536c;">
        <a class="aui-pull-left aui-btn" onclick="AppGoBack()">
            <span class="aui-iconfont aui-icon-left" style="color: #FFFFFF;"></span>
        </a>
        <div class="aui-title" style="color: #FFFFFF;">货栈应用</div>
    </header>
    <div class="content">
        <ul class="list">
            <li>
                <div class="box">
                    <a onclick="openNewPage('boutique.html')">
                        <div class="box-flex box_img">
                            <img src="../images/boutique_send.png" alt="精品出货">
                            <span>精品出货</span>
                        </div>
                    </a>
                    <a onclick="boutique()">
                        <div class="box-flex box_img">
                            <img src="../images/boutique.png" alt="精品验证">
                            <span>精品验证</span>
                        </div>
                    </a>
                    <a href="#" onclick="openPickUpPage()">
                        <div class="box-flex box_img">
                            <img src="../images/pickUP.png" alt="提货记录">
                            <span>提货记录</span>
                        </div>
                    </a>

                    <a href="#" onclick="storeFlag()">
                        <div class="box-flex">
                            <img src="../images/integral.png" alt="会员签到">
                            <span>会员签到</span>
                        </div>
                    </a>
                </div>
            </li>
            <li>
                <div class="box">
                    <a onclick="openNewPage('money_box.html')">
                        <div class="box-flex box_img">
                            <img src="../images/box.png" alt="精品出货">
                            <span>预付货款</span>
                        </div>
                    </a>
                    <a href="javascript:;" >
                        <div class="box-flex box_img">
                         
                        </div>
                    </a>
                    <a href="javascript:;" >
                        <div class="box-flex box_img">
                          
                        </div>
                    </a>

                    <a href="javascript:;" >
                        <div class="box-flex">
                          
                        </div>
                    </a>
                </div>
            </li>

        </ul>


        <div class="text">
            <h3> <span></span>货栈应用运营指南<span></span></h3>
           <div class="text-list">
                <p>1、门店选择专供精品进行出货 </p>
                <p>2、客户到店购买专供精品</p>
                <p>3、扫码激活精品，赠送积分</p>
                <p>4、客户每日进店签到送积分</p>
                <p>5、深度挖掘，共享经济，建立项目合伙人</p>
           </div>
        </div>
    </div>

</body>

</html>